<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>广告联调平台</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link href="../layui/css/layui.css" rel="stylesheet">
</head>
<body>
  <div class="layui-layout layui-layout-admin">
    <div class="layui-header">
      <div class="layui-logo layui-hide-xs layui-bg-black">广告联调平台</div>
      <!-- 头部区域（可配合layui 已有的水平导航） -->
      <ul class="layui-nav layui-layout-right">
        <li class="layui-nav-item layui-hide layui-show-sm-inline-block">
          <a>
            <img src="../img/yonghu.png" class="layui-nav-img">
            <span id="uName"></span>
          </a>
          <dl class="layui-nav-child">
            <dd><a lay-on="confirm">退出登录</a></dd>
          </dl>
        </li>
      </ul>
    </div>
    <div class="layui-side layui-bg-black">
      <div class="layui-side-scroll">
        <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
        <ul class="layui-nav layui-nav-tree" lay-filter="test">
          <li class="layui-nav-item layui-nav-itemed"><a href="admin.html">首页</a></li>
          <li class="layui-nav-item">
            <a class="" href="javascript:;">oppo</a>
            <dl class="layui-nav-child">
              <dd><a href="admin.html">数据汇总</a></dd>
              <dd><a href="admin.html">数据明细</a></dd>
              <dd><a href="admin.html">链接管理</a></dd>
            </dl>
          </li>
          <li class="layui-nav-item"><a href="admin.html">完善信息</a></li>
        </ul>
      </div>
    </div>
    <div class="layui-body">
      <!-- 内容主体区域 -->
      <div style="padding: 15px;">
        <blockquote class="layui-elem-quote layui-text">
          首页
        </blockquote>
        <div class="layui-row layui-col-space15">
          <div class="layui-col-md5">
            <div class="grid-demo grid-demo-bg1">
              <div class="layui-card layui-panel" style="background-color: #DCE2F1;">
                <div class="layui-card-header">
                  简介
                </div>
                <div class="layui-card-body">
                  联调联调联调联调联调联调<br>
                  联调联调联调联调联调联调<br>
                  联调联调联调联调联调联调<br>
                  联调联调联调联调联调联调<br>
                  联调联调联调联调联调联调<br>
                  联调联调联调联调联调联调<br>
                </div>
              </div>
            </div>
          </div>
        </div>
        <br><br>
      </div>
    </div>
    <div class="layui-footer" style="text-align: center;">
      <!-- 底部固定区域 -->
      WYK内测版
    </div>
  </div>

  <script src="../layui/layui.js"></script>
  <script>
    //JS
    layui.use(['element', 'layer', 'util'], function(){
      var layer = layui.layer;
      var util = layui.util;
      var $ = layui.$;
      var query = layui.jquery;
      var userInfo = {};

      window.onload = function() {
        query.ajax({
          type:"POST",
          url:"/user/queryUser",
          success:function(result){
            if (result.success === true) {
              userInfo = result.user;
              $('#uName').text(userInfo.mobileNo);
            } else {
              layer.alert('获取用户信息失败，请重新登录！', {
                title: '发生错误'
              });
              setTimeout(function(){
                window.location.href = "/";
              }, 1500)
            }
          },
          error:function(){
            layer.alert('访问链接不存在！', {
              title: '发生错误'
            });
          }
        });

      };


      util.on('lay-on',{
        confirm: function() {
          layer.confirm('是否退出登录？', {
            btn: ['确定']
          }, function(){
            query.ajax({
              type:"GET",
              url:"/user/logout",
              success:function(result){
                if (result.success === true) {
                  layer.msg(result.msg, { icon:1 });
                  setTimeout(function(){
                    window.location.href = "/";
                  }, 1500)
                } else {
                  layer.msg(result.msg, { icon:2 });
                }
              },
              error:function(){
                layer.alert('访问链接不存在！', {
                  title: '发生错误'
                });
              }
            })
          })
        }
      })

    });
  </script>

  <script>
    document.addEventListener("contextmenu", function(event){
      event.preventDefault();
    });
    document.onkeydown = function(){
      if(window.event && window.event.keyCode == 123) {
        alert("请勿通过F12调试访问页面！");
        event.keyCode = 0;
        event.returnValue = false;
      }
    }
    window.addEventListener("keydown", function(event) {
      // 检测是否按下了F12键或Ctrl+Shift+I组合键
      if (event.key === "F12" || (event.ctrlKey && event.shiftKey && event.key === "I")) {
        // 跳转到其他页面
        window.location.href = "https://www.baidu.com/";
      }
    });
  </script>

</body>
</html>